import { ADDITEM } from './constants'

export default function (state = { list: ['a', 'b'] }, action) {
  switch (action.type) {
    case ADDITEM:
      const newList = [...state.list]
      newList.push(action.item)
      return {
        ...state,
        list: newList,
      }
    default:
      return state
  }
}
